package recursion;

/**
 * @author huangxin
 * @date 2019/6/22-22:49
 */
public class RecursionTest {
    public static void main(String[] args) {
        System.out.println(factorial(10));
    }
    private  static  void  test(int n){
        if (n>1){
            test(n-1);
        }
        System.out.println("n = " + n);
    }


    //阶乘问题
    public static int factorial(int n){
        if (n==1){
            return 1;
        }else{
            return factorial(n-1)*n;
        }
    }
}
